package telcoGUI.actionListener;

import telcoGUI.userInterface.TelcoClientGUI;
import java.awt.event.WindowAdapter;
import java.awt.event.WindowEvent;

public class TelcoGUIWindowAdapter extends WindowAdapter
{
	private TelcoClientGUI telcoGUI;
	
	public TelcoGUIWindowAdapter(TelcoClientGUI telcoGUI)
	{
		this.telcoGUI = telcoGUI;
	}
	
	@Override
	public void windowClosing(WindowEvent e)
	{
		if (this.telcoGUI.getTelcoClient() != null) 
				this.telcoGUI.getTelcoClient().disconnectFromProvider();
	}
}
